return "HYPERTEXT - GO TO MARKER" & RETURN & RETURN & "This behavior allows you to use Text member hyperlinks to jump to the various markers of the current movie." & RETURN & RETURN & "You can create links with the words" & RETURN & " first" & RETURN & " previous" & RETURN & " next" & RETURN & " last" & RETURN & "to navigate between markers, or you can use specific marker names." & RETURN & RETURN & "To create a hyperlink in a Text member, open the Text window and select the word(s) that you wish to use as the anchor. Now open the Text Inspector and type the name of a marker. When you run your movie, a click on the anchor text will move the playback head to the chosen marker." & RETURN & RETURN & "PERMITTED MEMBER TYPES:" & RETURN & "Text members" & RETURN & RETURN & "PARAMETERS:" & RETURN & "* Use Hyperlink Styles?" & RETURN & "If you select this option, the anchor text will appear underlined and in blue. A visited link will automatically appear in pink."
end
on getBehaviorTooltip me
return "Use with Text members." & RETURN & RETURN & "Create hyperlinks to navigate to the" & RETURN & "various markers of the current movie." & RETURN & RETURN & "You can use specific marker names or" & RETURN & "the words 'first', 'previous', 'next'" & RETURN & "and 'last'."
if marker(1) <> marker(-(the maxinteger) / 2) then
i = 0
repeat while i >= -(the maxinteger)
checkMarker = marker(i)
if checkMarker = lastCheckedMarker then
exit repeat
end if
lastCheckedMarker = checkMarker
markerlist.addProp(checkMarker, 0)
i = -1 + i
end repeat
end if
if marker(0) <> marker(the maxinteger / 2) then
i = 1
repeat while i <= the maxinteger
checkMarker = marker(i)
if checkMarker = lastCheckedMarker then
exit repeat
end if
lastCheckedMarker = checkMarker
markerlist.addProp(checkMarker, 0)
i = 1 + i
end repeat
end if
markerLinks = [:]
theLinks = myMember.hyperlinks
linkCount = theLinks.count
i = 1
repeat while i <= linkCount
theRange = theLinks[i]
theData = myMember.char[theRange[1]].hyperlink
markerLinks.addProp(theData, theRange)
i = 1 + i
end repeat
i = markerlist.count()
theLabels = the labelList
repeat while i
markerName = theLabels.line[i]
rangePos = markerLinks.findPos(markerName)
if not rangePos then
rangePos = markerLinks.count()
repeat while rangePos
if markerLinks.getPropAt(rangePos) = markerName then
exit repeat
end if
rangePos = rangePos - 1
end repeat
end if
if rangePos then
markerlist[i] = markerLinks[rangePos][1]
end if
i = i - 1
end repeat
return markerlist
end
on ErrorAlert me, theError, Data
case theError of
#getPDLError:
alert("Error: This behavior works only with Text members." & RETURN & RETURN & "Hit OK and then delete this behavior from the sprite." & RETURN & RETURN & "For more information on deleting Behaviors, see the Help system.")
if the optionDown then
return [#getPDLError: [#comment: "ERROR: Wrong member type. Click 'Cancel'." & RETURN & " Use only with Text members.", #format: #string, #range: [EMPTY], #default: EMPTY]]
end if
otherwise:
behaviorName = string(me)
delete word 1 of behaviorName
delete char -30001 of behaviorName
delete char -30001 of behaviorName
case theError of
#invalidMemberType:
if the runMode = "Author" then
alert("BEHAVIOR ERROR: Frame " & the frame & ", Sprite " & me.spriteNum & RETURN & RETURN & "Behavior " & behaviorName & " only works with Text members." & RETURN & RETURN & "Current member type = #" & Data)
end if
abort()
#invalidMarker:
if the runMode = "Author" then
alert("BEHAVIOR ERROR: Frame " & the frame & ", Sprite " & me.spriteNum & RETURN & RETURN & "Behavior " & behaviorName & " could not find a marker called " & QUOTE & Data & QUOTE & ".")
end if
end case
end case
end
on getPropertyDescriptionList me
if not (the currentSpriteNum) then
exit
end if
theMember = sprite(the currentSpriteNum).member
if theMember.type <> #text then
return ErrorAlert(me, #getPDLError)
end if
return [#myHyperStyle: [#comment: "Use the standard hyperlink style?", #format: #boolean, #default: 1]]